package com.music.music.service.impl;

import java.util.List;

import com.music.common.core.utils.SnowflakeIdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.music.music.mapper.SingerMapper;
import com.music.music.domain.Singer;
import com.music.music.service.SingerService;

import javax.annotation.Resource;

/**
 * 歌手列表Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-22
 */
@Service
public class SingerServiceImpl implements SingerService {
    @Resource
    private SingerMapper singerMapper;

    /**
     * 查询歌手列表
     *
     * @param singerId 歌手列表主键
     * @return 歌手列表
     */
    @Override
    public Singer selectSingerBySingerId(Long singerId) {
        return singerMapper.selectSingerBySingerId(singerId);
    }

    /**
     * 查询歌手列表列表
     *
     * @param singer 歌手列表
     * @return 歌手列表
     */
    @Override
    public List<Singer> selectSingerList(Singer singer) {
        return singerMapper.selectSingerList(singer);
    }

    /**
     * 新增歌手列表
     *
     * @param singer 歌手列表
     * @return 结果
     */
    @Override
    public int insertSinger(Singer singer) {
        Long singerId = SnowflakeIdWorker.generateId();
        singer.setSingerId(singerId);
        return singerMapper.insertSinger(singer);
    }

    /**
     * 修改歌手列表
     *
     * @param singer 歌手列表
     * @return 结果
     */
    @Override
    public int updateSinger(Singer singer) {
        return singerMapper.updateSinger(singer);
    }

    /**
     * 批量删除歌手列表
     *
     * @param singerIds 需要删除的歌手列表主键
     * @return 结果
     */
    @Override
    public int deleteSingerBySingerIds(Long[] singerIds) {
        return singerMapper.deleteSingerBySingerIds(singerIds);
    }

    /**
     * 删除歌手列表信息
     *
     * @param singerId 歌手列表主键
     * @return 结果
     */
    @Override
    public int deleteSingerBySingerId(Long singerId) {
        return singerMapper.deleteSingerBySingerId(singerId);
    }



}
